exception Empty;

type t 'a;

value create: unit -> t 'a;

value is_empty: t 'a -> bool;
value clear: t 'a -> unit;

value push_front: t 'a -> 'a -> unit;
value get_front: t 'a -> 'a;
value drop_front: t 'a -> unit;
value take_front: t 'a -> 'a;

value push_back: t 'a -> 'a -> unit;
value get_back: t 'a -> 'a;
value drop_back: t 'a -> unit;
value update_back: t 'a -> 'a -> unit;

value iter: ~f:('a->unit) -> t 'a -> unit;
value fold_left: ~f:('a -> 'b -> 'a) -> 'a -> t 'b -> 'a;
value fold_right: ~f:('a -> 'b -> 'b) -> t 'a -> 'b -> 'b;
value to_list: t 'a -> list 'a;
